package com.yh.util;

import com.yh.javabean.TUser;
import dao.TUserDao;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import java.util.ArrayList;

public class TUserDaoTest {
    public static void main(String[] args) {
        SqlSessionFactory factory = MyBatisUtil.getSqlSessionFactory();
        SqlSession session = factory.openSession(true);
        TUserDao dao = session.getMapper(TUserDao.class);

//        ArrayList<TUser> tUsers = dao.selectAll();
//        for (TUser tUser : tUsers) {
//            System.out.println(tUser);
//        }

//        ArrayList<TUser> tUsers = dao.selectAll1();
//        for (TUser tUser : tUsers) {
//            System.out.println(tUser);
//        }
        ArrayList<TUser> tUsers = dao.selectAll2();
        for (TUser tUser : tUsers) {
            System.out.println(tUser);
        }


        session.close();
    }
}
